package com.zking.mapper;

import com.zking.entity.Role;
import com.zking.entity.User;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper {
    int insert(Role record);

    int insertSelective(Role record);

    List<Role> queryRolesByUser(User user);

    boolean addUserRole(Integer userId, Integer roleId);

    boolean deleteUserRole(Integer userId, Integer roleId);

    boolean deleteAuthority(Integer roleId, Integer resourcesId);

    boolean addAuthority(Integer roleId, Integer resourcesId);

    List<Role> selectAll();
}